package com.qdlc.p2p.biz.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qdlc.p2p.biz.service.ScoreLogService;
import com.qdlc.p2p.dal.common.model.jpa.OrderFilter.OrderType;
import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.common.model.jpa.QueryParam;
import com.qdlc.p2p.dal.dao.ScoreLogDao;
import com.qdlc.p2p.dal.dto.ScoreLog;
import com.qdlc.p2p.dal.model.ScoreLogModel;

@Service("scoreLogService")
public class ScoreLogServiceImpl implements ScoreLogService {

    @Resource
    private ScoreLogDao scoreLogDao;

    @Override
    public PageDataList<ScoreLogModel> findPageList(ScoreLogModel model) {
        return scoreLogDao.findPageList(model);
    }

    @Override
    public List<ScoreLog> getLottery() {
        QueryParam param = QueryParam.getInstance();
        param.addParam("type", "score_lottery");
        param.addOrder(OrderType.DESC, "id");
        return scoreLogDao.findByCriteria(param);
    }
}
